<template>
  <el-button @click="back()">返回</el-button>
  <el-form :model="form" label-width="auto" style="max-width: 600px">
    <el-form-item label="图片">

      <img
          :src="form.image"
          style="width: 100%"
      />

    </el-form-item>
    <el-form-item label="活动名称">
      <el-input v-model="form.name" type="button" />
    </el-form-item>
    <el-form-item label="活动内容">
      <el-input v-model="form.des" type="button" />
    </el-form-item>
    <el-form-item label="开始时间">
      <el-input v-model="form.startTime" type="button" />
    </el-form-item>
    <el-form-item label="结束时间">
      <el-input v-model="form.endTime" type="button" />
    </el-form-item>
  </el-form>
</template>

<script  setup>
import {reactive, ref} from 'vue'
import {useRoute, useRouter} from "vue-router";
import axios from "axios";

const router = useRouter();
const route = useRoute()
const name1= route.query.name

const form = ref({})
const aa=ref({
  name:name1
})

function back(){
  router.go(-1)
}

function show(){
  axios.post(`http://localhost:8813/activity/findByName?name=${name1}`).then(res=>{
    console.log(res)
      form.value=res.data.data[0]
})
}
show()
</script>
